# -*- coding:utf-8 -*-
import hashlib
import sys
def get_cmd5(md5str):

    m1 = hashlib.md5()
    m1.update(md5str.encode("utf-8"))
    result = m1.hexdigest()
    return result
def get_file_lines(filename):
    with open(filename) as f:
        line_list = f.readlines()
        return line_list
lines = get_file_lines((sys.argv[2]))
encode_str = (sys.argv[1])
for line in lines:
    line = line.strip() #去除换行符
    if encode_str == get_cmd5(line):
        print("解密成功！密码是: "+line)
        break
    else:
        continue
